﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Petroleum.DB;
using Petroleum.DB.Model;
using HZH_Controls;
using Petroleum.Model;
using Petroleum.Tool;

namespace Petroleum.UC.Public
{
    public partial class Step2_CPC : UserControl, HZH_Controls.Controls.IDataGridViewCustomCell
    {
        private Pressure item = null;
        public Step2_CPC()
        {
            InitializeComponent();
        }
        public void SetBindSource(object obj)
        {
            if (obj is Pressure)
                item = (Pressure)obj;
            if (item != null)
            {
                string imgc = "";
                switch (item.ColumnarSection)
                {
                    case "1":
                        imgc = SpireDocUtil.ImagesPath + "Images\\CS1.png";
                        break;
                    case "2":
                        imgc = SpireDocUtil.ImagesPath + "Images\\CS2.png";
                        break;
                    case "3":
                        imgc = SpireDocUtil.ImagesPath + "Images\\CS3.png";
                        break;
                    case "4":
                        imgc = SpireDocUtil.ImagesPath + "Images\\CS4.png";
                        break;
                    case "5":
                        imgc = SpireDocUtil.ImagesPath + "Images\\CS5.png";
                        break;
                }
                pic.Image = Image.FromFile(imgc);
            }
        }
    }
}
